package com.xjscrm.server.common.util;

import com.xjscrm.common.entity.WwDevice;
import com.xjscrm.server.vo.device.Device;

/**
 * @author liuqi
 * @date 2024年04月19日 17:59
 */
public class DeviceTools {
    /**
     * 从wwDevice转换成Device
     *
     * @param wwDevice 上线实体类
     * @return 实例对象
     */
    public static Device transDevice(WwDevice wwDevice) {
        if (wwDevice == null) {
            return null;
        }
        Device device = new Device();
        device.setDeviceUniqueId(wwDevice.getId());
        device.setId(wwDevice.getId());
        device.setMerId(wwDevice.getMerId());
        device.setDeviceType(wwDevice.getDeviceType());
        device.setDeviceId(wwDevice.getDeviceId());
        device.setCorpId(wwDevice.getCorpId());
        device.setDeviceName(wwDevice.getDeviceName());
        return device;
    }

}
